<template>
  <div class="home">
    <h1 v-red>自定义指令</h1>
    <h1 v-red>自定义指令2222</h1>
  </div>
</template>

<script>
export default {
  directives: {
    red(el) {
      el.style.color = "red";
    },
    //自定义指令的简写
  },
};
</script>
